#ifndef CLOCK_CALENDARBLOCK_HPP
#define CLOCK_CALENDARBLOCK_HPP

#include <cpp3ds/Graphics/Drawable.hpp>
#include <cpp3ds/Graphics/Text.hpp>
#include <cpp3ds/Window/Event.hpp>
#include <cpp3ds/System/Clock.hpp>
#include "TweenObjects.hpp"
#include <TweenEngine/Tween.h>
#include <TweenEngine/TweenManager.h>
#ifndef EMULATION
#include <3ds.h>
#endif

namespace Clock {

class CalendarBlock : public cpp3ds::Drawable, public util3ds::TweenTransformable<cpp3ds::Transformable> {
public:
	enum PresetDay {
		None = 0,
		Saturday,
		Sunday,
	};

	void update(float delta);

	void setBlockText(cpp3ds::String text);
	cpp3ds::String getBlockText();

	void setPosition(float posX, float posY);
	cpp3ds::Vector2f getPosition();

	cpp3ds::Vector2f getSize();

	void setSelectedColor(cpp3ds::Color newColor);
	cpp3ds::Color getSelectedColor();

	void setPreset(PresetDay newPreset);
	PresetDay getPreset();
	void toggleInverted();
	bool isInverted();
	void toggleSelected();
	bool isSelected();

	CalendarBlock();
	~CalendarBlock();

protected:
	virtual void draw(cpp3ds::RenderTarget& target, cpp3ds::RenderStates states) const;

private:
	util3ds::TweenRectangleShape m_calendarBlockDial;
	util3ds::TweenRectangleShape m_selectedSquare;
	util3ds::TweenText m_textDate;

	void changePresets(PresetDay newPreset, bool isInverted);

	PresetDay m_presetDay;
	bool m_isInverted;
	bool m_isSelected;

	TweenEngine::TweenManager m_tweenManager;

};

} // namespace Clock

#endif // CLOCK_CALENDARBLOCK_HPP
